import {takeEvery, put} from 'redux-saga/effects'
import { product_by_id, products_by_id_success} from '../actions/productInfo'
import axios from 'axios'
import {API} from '../../config'
function* handleSignup (action) {

    let response = yield axios.get(`${API}/product/${action.payload.productId}`)
    yield put(products_by_id_success(response.data))
    
    
}

export default function* productInfoSaga () {
    yield takeEvery(product_by_id,handleSignup)
}